package com.psmz.iwi.docanalyzer.core.settings;

import java.util.Properties;

public class ApplicationSettings {
	private String indexPath;
	private String databaseConnectionString;
	private String userName;
	private String password;

	public String getIndexPath() {
		return indexPath;
	}

	public void setIndexPath(String indexPath) {
		this.indexPath = indexPath;
	}

	public String getDatabaseConnectionString() {
		return databaseConnectionString;
	}

	public void setDatabaseConnectionString(String databaseConnectionString) {
		this.databaseConnectionString = databaseConnectionString;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public static ApplicationSettings create(Properties properties) {

		ApplicationSettings settings = new ApplicationSettings();
		settings.setDatabaseConnectionString((String) properties
				.get("settings.connectionString"));
		settings.setIndexPath((String) properties.get("settings.indexPath"));
		settings.setUserName((String) properties.get("settings.username"));
		settings.setPassword((String) properties.get("settings.password"));
		return settings;

	}

}
